package com.czn.shoppingmall.util;

import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class RequestUtil {
    public static String getInputString(HttpServletRequest request) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(
                request.getInputStream(), "UTF-8"));
        StringBuilder sb = new StringBuilder();
        String line = null;
        while ((line = in.readLine()) != null) {
            sb.append(line);
        }
        return sb.toString();
    }
}
